<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>最新课题</title>
<link type="text/css" rel="stylesheet" href="../include/css/main.css" />
<link type="text/css" rel="stylesheet" href="../include/css/search.css" />
<script type="text/javascript" src="../include/script/jquery.js" ></script>
<script type="text/javascript" src="../include/script/main_ui_control.js"></script>
<script type="text/javascript" src="../include/script/search.js"></script>

 <script src="../include/artDialog/artDialog.source.js?skin=default" type="text/javascript"></script>
 <script src="../include/artDialog/plugins/iframeTools.source.js" type="text/javascript"></script>
 <script src="../include/artDialog/plugins/iframeTools.js" type="text/javascript"></script>


<script type="text/javascript">



window.onload = function(){
	//绘制菜单背景，需要html5支持
	drawBG();
	//菜单动画
	menu_animation();
	//菜单事件绑定
	
	//初始化selection
	search_selection();
}

function doSearch()
{

 var selectItem= $("select[name='type']").val();

if(selectItem=="学生")
{ 
  $.post("searchAction!GetStudentByGarden",  
             {gName: $("select[name='department']").val()},  
           function(returnedData, status){  
                 if("success" == status){  
 
                     if("success" == returnedData)
                      {
                      //在这里执行替换网页的动作
                     // $(".searchresult").load("studentList.jsp");
                         window.location.href="studentList.jsp";                    
                      }
                      else
                      {
                      
                        $('.searchresult').load('projectList.jsp');
                       showWrong("获取信息失败：" + returnedData);
                      }
                                    
             }  
            }  
        );
}
if(selectItem=="老师")
{ 
  $.post("searchAction!GetProjectByGarden",  
             {gName: $("select[name='department']").val()},  
           function(returnedData, status){  
                 if("success" == status){  
                      if("success" == returnedData)
                      {
                      //在这里执行替换网页的动作
                      $(".searchresult").load();
                      }
                      else
                      {
                       showWrong("获取信息失败：" + returnedData);
                      }
             }  
            }  
        );
}

if(selectItem=="项目")
{ 
  $.post("searchAction!GetProjectByGarden",  
             {gName: $("select[name='department']").val()},  
           function(returnedData, status){  
                 if("success" == status){  
                      if("success" == returnedData)
                      {
                      //在这里执行替换网页的动作
                      }
                      else
                      {
                       showWrong("获取信息失败：" + returnedData);
                      }
             }  
            }  
        );
}

}


    function showWrong(mes)  //审核过程出现异常
        {
            art.dialog({
                opacity: 0.25, // 透明度
                icon: 'error',
                width: '15em',
                height: 80,
                title: '失败',
                content: mes,
                ok: true
            });
        }


</script>
</head>

<body>
<div class="content">
	<div class="top_info">
    	<img src="../include/img/search.png" />
        <div>
        	<span>学部：</span>
            <select name="faculty">
            </select>
            <span>院系：</span>
            <select name="department" id="searchName">
            </select>
            <span>查找对象：</span>
            <select name="type" id="typeName">
            	<option value="学生">学生</option>
                <option value="老师">老师</option>
            </select>
            
            <a href="#"onclick="doSearch()" > 查找</a>
           
        </div>
    </div>
    <hr class="line" />
    
    <div class="searchresult">
    
    </div>
  
    
</div>
<div id="_bottom_menu">
    <ul id="bottom_menu_left">
    </ul>
    <ul id="bottom_menu_right">
        <li id="menu_item_personla">个人中心</li>
        <li id="menu_item_project">科研课题</li>
        <li id="menu_item_search">查找</li>
        <li id="menu_item_others">其他</li>
    </ul>
    <canvas id="bg_canvas_left"></canvas>
    <canvas id="bg_canvas_right"></canvas>
</div>
<script language="javascript">

</script>
</body>
</html>
